Skip to content

[pull] main from bazel-contrib:main#592

Merged
pull[bot] merged 1 commit intogarymm:mainfrom
bazel-contrib:main
Apr 27, 2026
Merged

[pull] main from bazel-contrib:main#592
pull[bot] merged 1 commit intogarymm:mainfrom
bazel-contrib:main

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented Apr 27, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

Currently, the files from the data, headers, and scripts portions of a
wheel don't end up in the proper sub-directories of the venv. This
means the full files of a distribution aren't available at the typical
location in the venv, making it harder to integrate with standard
tools.

To fix, simply map the directories to paths in the venv and give them
similar treatment as site-packages.

The spec says certain first-level directories of the `.data` directory
map to specific scheme paths, which `whl_library` already handles.
Here's a listing of the
`wheel data directory -> install scheme path key -> whl_library
directory`
relationships

* purelib -> purelib -> site-packages
* platlib -> platlib -> site-packages
* headers -> include -> include
* scripts -> scripts -> bin
* data -> data -> data

Relevant reading:
* Packaging specification:

https://packaging.python.org/en/latest/specifications/binary-distribution-format
* Posix install scheme paths:
  https://docs.python.org/3/library/sysconfig.html#posix-prefix
* Windows install scheme paths:
  https://docs.python.org/3/library/sysconfig.html#nt

The whl_library rule uses posix names for extracting. When
materialized into a binary's venv, platform specific names are used:

* bin -> (posix) bin; (Windows) Scripts
* include -> (posix) include; (Windows) Include (capital i)
* data -> venv root directory

Along the way ...

* The data files (files under the "data" scheme of a whl) are now
  always included as part of depending on the library. They would be
  in included in venv_site_packages=yes mode, so this better aligns
  behavior of the two modes.
* Rename `is_venv_site_packages` to `_is_venv_site_packages_yes` to
  better represent the purpose and visibility of it.
* Make whl_from_dir support Windows. Testing of venvs relies on
  using it for testing various special cases.
@pull pull Bot locked and limited conversation to collaborators Apr 27, 2026
@pull pull Bot added the ⤵️ pull label Apr 27, 2026
@pull pull Bot merged commit 12eac29 into garymm:main Apr 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant